package com.read.resp;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @ClassName BaseResp
 * @Description TODO
 * @Author young
 * @Date 2022-09-26 22:45
 * @Version 1.0
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BaseResp {

    private Integer code;
    private String msg;
    private Object data;
    private Long total;

    public BaseResp Success(String msg,Object data,Long total){
        return new BaseResp(1,msg,data,total);
    }
    public BaseResp Error(String msg){
        return new BaseResp(0,msg,null,null);
    }
    public BaseResp UnAuthor(String msg){
        return new BaseResp(0,msg,null,null);
    }
}
